package Student;

import java.sql.Connection;
import java.sql.DriverManager;

public class DBUtil {

        static{
            try {
                Class.forName("com.mysql.cj.jdbc.Driver");
            } catch (ClassNotFoundException e) {
                e.printStackTrace();
            }

        }

        public static Connection getConnection() throws Exception
        {
            return DriverManager.getConnection
                    ("jdbc:mysql://localhost:3306/jsd2404?characterEncoding=utf8&useSSL=false&serverTimezone=Asia/Shanghai&rewriteBatchedStatements=true",
                     "root",
                     "root");
        }



}